"""EdmureBlog URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from .views import home
from .views import account

urlpatterns = [
    url(r'^login.html$', account.login),    # 登录
    url(r'^logout.html$', account.logout),    # 注销
    url(r'^register.html$', account.register),    # 注册
    url(r'^check_code.html$', account.check_code),    # 验证码
    url(r'^reply.html$', home.reply),  # 回复别人评论
    url(r'^all/(?P<article_type>\d+).html$', home.index),    # 博客首页, 根据分类展示博文
    url(r'^(?P<site>\w+).html', home.home,name='home'),    # 博主个人首页
    url(r'^(?P<site>\w+)/(?P<condition>((tag)|(date)|(category)))/(?P<val>\w+-*\w*).html', home.filter,name='filter'),
    url(r'^(?P<site>\w+)/(?P<nid>\d+).html', home.detail,name="home-detail"),    # 博文详细页
    url(r'submit_comment/$', home.submit_comment),    # 发表评论
    url(r'updown/$', home.updown),    # 顶或踩
    url(r'addfans/$', home.addfans),    # 加粉
    url(r'^', home.index),    # 博客首页，展示全部博文
]
